package com.pai.test;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

public class UDPReciever {
	public static void main(String[] args) throws SocketException {  
        DatagramSocket clientDSocket ;  
        DatagramPacket receiveDP = new DatagramPacket(new byte[1024], 1024);  
        clientDSocket = new DatagramSocket(9998);  
        try {  
        	while(true){
                 clientDSocket.receive(receiveDP);  
                 System.out.println(receiveDP.getAddress()+"   "+receiveDP.getPort());  
        	}
        } catch (IOException e) {  
                 e.printStackTrace();  
        }  
	} 
}
